﻿<UserControl x:Class="Agnes.TaskManager.TaskLabelsEditView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" mc:Ignorable="d" 
             d:DesignHeight="379" d:DesignWidth="226">
    <Grid>
        <Grid.RowDefinitions >
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <ListBox Margin="10" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" MinWidth="180"
                 x:Name="lbLabels" MinHeight="200" ItemsSource="{Binding Model}" SelectedItem="{Binding Path=SelLabel}"
                 Background="AliceBlue" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border BorderBrush="CornflowerBlue" BorderThickness="1.5">
                        <TextBlock Text="{Binding Path=DisplayName}" Width="180">
                            <TextBlock.Background>
                                <SolidColorBrush Color="{Binding Path=Color}" />
                            </TextBlock.Background>
                        
                        </TextBlock>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
            <TextBlock Text="名称: " Grid.Row="1" Grid.Column="0" Margin="10" VerticalAlignment="Center"/>
            <dxe:TextEdit Margin="5" NullText="请输入名称" Text="{Binding Path=LabelDisplayName,Mode=TwoWay}" Grid.Row="1" Grid.Column="1" MinWidth="120"/>
            <TextBlock Text="颜色：" VerticalAlignment="Center" Margin="10,0" Grid.Row="2"/>
            <dxe:PopupColorEdit Color="{Binding Path=LabelColor,Mode=TwoWay}" Grid.Row="2" Grid.Column="1" Margin="5" MinWidth="100" />
        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2">
            <Button x:Name="Del" Content="删除" Grid.Row="3" Grid.Column="0" Margin="10" MinWidth="60"
                        Background="LightBlue" BorderBrush="Black" />
            <Button x:Name="Modify" Content="修改" Grid.Row="3" Grid.Column="2" Margin="5,10" 
                        Background="LightBlue" BorderBrush="Black" MinWidth="60" 
                        HorizontalAlignment="Left" />
            <Button x:Name="Add" Content="添加" Grid.Row="3" Grid.Column="2" Margin="5,10" 
                        Background="LightBlue" BorderBrush="Black" MinWidth="60" 
                        HorizontalAlignment="Left" />
        </StackPanel>
    </Grid>
</UserControl>
